package com.zhiqian.community.dao;

import com.zhiqian.community.entity.DiscussPost;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
@SuppressWarnings("all")
public interface DiscussPostMapper {
    List<DiscussPost> selectDiscussPosts(@Param("userId") Integer userId,@Param("offset") int offset,@Param("limit") int limit,@Param("orderMode") int orderModel);

    int selectDiscussPostRows(@Param("userId")Integer userId);

    int insertDiscussPost(DiscussPost discussPost);

    DiscussPost selectDiscussPostById(Integer id);

    int incrementCommentCount(Integer discussPostId);

    int updateDiscussPostsStatus(@Param("discussPostId") Integer discussPostId,@Param("status") Integer status);

    int updateDiscussPostType(@Param("discussPostId")Integer discussPostId,@Param("type")Integer type);

    int updateDiscussPostScore(@Param("discussPostId")Integer discussPostId,@Param("score")Double score);

    DiscussPost selectDraftPost(Integer userId);

    int updateDraft(DiscussPost discussPost);

    int update(DiscussPost discussPost);
}
